home *** CD-ROM | disk | FTP | other *** search
/ Aminet 51 / Aminet 51 (2002)(GTI - Schatztruhe)[!][Oct 2002].iso / Aminet / dev / c / minigl.lha / MiniGL / src / kprintf.c < prev    next >
Encoding:
C/C++ Source or Header  |  2002-03-27  |  914 b   |  55 lines

  1. /*
  2. ** This is a replacement for the amiga.lib kprintf for PowerPC.
  3. ** It uses the WarpUp SPrintF function to do debug output
  4. ** to the serial connector (or Sushi, if it's installed).
  5. */
  6.  
  7. #include "sysinc.h"
  8. #include <stdarg.h>
  9. #include <stdio.h>
  10.  
  11. #ifdef __VBCC__
  12. #pragma amiga-align
  13. #endif
  14.  
  15. #include <proto/exec.h>
  16.  
  17. #ifdef __STORM__
  18. #include <clib/powerpc_protos.h>
  19. #else
  20. #if defined (__STORMGCC__) || (defined (__VBCC__) && defined (__PPC__))
  21. #include <clib/powerpc_protos.h>
  22. #else
  23.     #ifndef __VBCC__
  24.     #include <powerpc/powerpc_protos.h>
  25.     #endif
  26. #endif
  27. #endif
  28.  
  29.  
  30. #ifdef __VBCC__
  31. #pragma default-align
  32. #endif
  33.  
  34. int kprintf(char *format, ...)
  35. {
  36. #ifndef NDEBUG
  37.     char msg[1024];
  38.     va_list marker;
  39.  
  40.     va_start(marker, format);
  41.     vsprintf(msg, format, marker);
  42.     va_end(marker);
  43.  
  44.     #ifndef __STORM__
  45.     #ifndef __STORMGCC__
  46.     #ifdef __PPC__
  47.     SPrintF(msg, 0);
  48.     #endif
  49.     #endif
  50.     #endif
  51. #endif
  52.     return 1;   /* fake something... */
  53.  
  54. }
  55.